package com.examination.client.config;


import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy;
import org.apache.poi.ss.usermodel.Sheet;

import java.util.List;

/**
 * @author: XiaoDong
 * @date: 2021-10-30 18:18
 * @description:
 */
public class ExcelWidthStyleStrategy extends AbstractColumnWidthStyleStrategy {


    @Override
    protected void setColumnWidth(WriteSheetHolder writeSheetHolder, List<CellData> list, org.apache.poi.ss.usermodel.Cell cell, Head head, Integer integer, Boolean aBoolean) {
        // 简单设置
        Sheet sheet = writeSheetHolder.getSheet();
        sheet.setColumnWidth(cell.getColumnIndex(), 6000);
    }
}
